function [ hasil ,hasil2] = y_Adams3(f,f2,x0,y0,z0,b,h)
%Y_ADAMS_BASHFORTH_MOULTON Summary of this function goes here
%   Detailed explanation goes here
    n = (b - x0) / h;
    y = y0;
    
    [y1 z1] = y_RK33(f,f2, x0, y0, z0, x0 + h, h);
    [y2 z2] = y_RK33(f,f2, x0, y0, z0, x0 + 2 * h, h);
    [y3 z3] = y_RK33(f,f2, x0, y0, z0, x0 + 3 * h, h);
    %z1 = y_RK33(f,f2, x0, y0, z0, x0 + h, h);
    %z2 = y_RK33(f,f2, x0, y0, z0, x0 + 2 * h, h);
    %z3 = y_RK33(f,f2, x0, y0, z0, x0 + 3 * h, h);
    x = x0 + 3 * h;
    
    syms a b c;
    
    for r = 4 : n
        y = y3 + h / 24 * (-9 * subs(f, [a b], [(x-3*h) y0]) + 37 * subs(f, [a b], [(x-2*h) y1]) - 59 * subs(f, [a b], [(x-h) y2]) + 55 * subs(f, [a b], [x y3]));
        y = y3 + h / 24 * (subs(f, [a b], [(x-2*h) y1]) - 5 * subs(f, [a b], [(x-h) y2]) + 19 * subs(f, [a b], [x y3]) + 9 * subs(f, [a b], [(x+h) y]));
        y0 = y1;
        y1 = y2;
        y2 = y3;
        y3 = y;
        z = z3 + h / 24 * (-9 * subs(f2, [a b c], [(x-3*h) y0 z0]) + 37 * subs(f2, [a b c], [(x-2*h) y1 z1]) - 59 * subs(f2, [a b c], [(x-h) y2 z2]) + 55 * subs(f2, [a b c], [x y3 z3]));
        z = z3 + h / 24 * (subs(f2, [a b c], [(x-2*h) y1 z1]) - 5 * subs(f2, [a b c], [(x-h) y2 z2]) + 19 * subs(f2, [a b c], [x y3 z3]) + 9 * subs(f2, [a b c], [(x+h) y z]));
        z0 = z1;
        z1 = z2;
        z2 = z3;
        z3 = z;
        x = x + h;
    end
    hasil2 = z;
    hasil = y;
end

